<?php
/**
 * @author Amissah Gideon<kuulmek@yahoo.com>
 * @access public
 * @version 1.0
 */

?>
<script type="text/javascript">
    var gbl_currency_opts = <?php echo json_encode($currency_opts); ?>;
    //console.log(global_equipment_data);
</script>

<!-- Main content -->
<section role="main" id="main">

    <!-- Header -->
    <?php
        echo $this->element('page_header');
        echo $this->element('navigations/report_navbar');
    ?>

    <div class="with-padding">
        <div class="columns">
            <div class="new-row-mobile twelve-columns six-columns-tablet twelve-columns-mobile">

                <h3 class="thin underline">Customers Sales Details Report</h3>

                <table id="flex" style="display:none;"></table>

                <div style="display: none;">
                    <div id="customer-sales-detail-window" style="padding:25px 20px 20px 20px;">
                        <!--<button type="reset" class="data-type-menu" id="print-repayment-btn" action="repayment" data-type="print">&nbsp;Print</button>
                        <button type="reset" class="data-type-menu" id="export-repayment-btn" action="repayment" data-type="export">&nbsp;Export to Excel</button>
-->
                        <button type="reset" class="button data-type-menu" id="print-repayment-btn" action="repayment" data-type="print">
                            <span class="button-icon anthracite-gradient"><span class="icon-printer"></span></span>
                            Print
                        </button>
                        <button type="reset" class="button data-type-menu" id="export-repayment-btn" action="repayment" data-type="export">
                            <span class="button-icon anthracite-gradient"><span class="icon-extract"></span></span>
                            Export to Excel
                        </button>
                        <div style="margin: 10px 0;">Customer: <strong id="customer_in_transaction"></strong></div>
                        <div style="margin-bottom: 10px;">Transactions in <strong id="transaction_currency"></strong></div>
                        <div class="tdDiv thflotDiv" style="overflow: auto; max-height: 400px;">
                            <table id="customer-sales-detail_flex" class="table table-bordered thfloat">
                                <thead>
                                <tr>
                                    <th width="100">Purchased Date</th>
                                    <th width="100">Sales No</th>
                                    <th width="130">Vehicle No</th>
                                    <th width="100">Opening Balance</th>
                                    <th width="100">Installment</th>
                                    <th width="100">Total Repayment</th>
                                    <th width="100">Undue</th>
                                    <th width="100">Past Due</th>
                                    <th width="100">Total Interest</th>
                                    <th width="100">Principal Balance</th>
                                    <th width="100">Total Balance</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <form id="print-export-form" method="post" action="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'get')); ?>" target="PrintExportWindow">
                    <input type="hidden" name="data_type" id="data_type" value="" />
                    <input type="hidden" name="data_ids" id="data_ids"  value="" />
                    <input type="hidden" name="pe_currency" id="pe_currency"  value="" />
                    <input type="hidden" name="pe_customer_id" id="pe_customer_id"  value="" />
                </form>

            </div>
        </div>
    </div>

</section>
<!-- End main content -->

<!-- Side tabs shortcuts -->
<?php echo $this->element('side_tabs_shortcuts'); ?>
<!-- Sidebar/drop-down menu -->
<?php echo $this->element('right_side_infos'); ?>


<!-- Users URL -->
<input type="hidden" id="table-url" value="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'get')); ?>"/>
<input type="hidden" id="add-edit-url" value="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'add')); ?>"/>
<input type="hidden" id="load-user-url" value="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'load')); ?>"/>
<input type="hidden" id="delete-url" value="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'delete_')); ?>"/>
<input type="hidden" id="repayment-url" value="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'repayment_details')); ?>"/>
<input type="hidden" id="amortization-url" value="<?php echo $this->Html->url(array('controller' => 'Report', 'action' => 'amortization')); ?>"/>

<?php
echo $this->Html->script('setup.js');

/** Template functions **/
echo $this->Html->script('developr.input.js');
echo $this->Html->script('developr.message.js');
echo $this->Html->script('developr.modal.js');
echo $this->Html->script('developr.navigable.js');
echo $this->Html->script('developr.notify.js');
echo $this->Html->script('developr.scroll.js');
echo $this->Html->script('developr.progress-slider.js');
echo $this->Html->script('developr.tooltip.js');
echo $this->Html->script('developr.confirm.js');
echo $this->Html->script('developr.agenda.js');
echo $this->Html->script('developr.tabs.js');

echo $this->Html->script('libs/tinycon.min.js');
echo $this->Html->script('jquery.thfloat-0.3.min.js');
echo $this->Html->script('custom-scripts/report_customer_details.js');
?>